function clickLinkEdit(e){
	var form = e.parentNode.parentNode.getElementsByClassName('editForm')[0];
	var name = e.parentNode.parentNode.getElementsByClassName('nameEdit')[0].value;
	if (name!= "") {
		form.submit();
	}	
	else { 
		e.parentNode.parentNode.getElementsByClassName('error')[0].style.display = 'block';
	}
}

function clickLinkDelete(e){
	var answer = confirm("Are you sure?");
	if (answer) {
		e.parentNode.submit();
	}
}

function validateAdd(){
	var name = document.getElementById("name").value;
	if ( name == "") {
		document.getElementById("errorAdd").style.display = 'block';
		return false;
	}
	else {
		return true;
	}
}